package dfbz.homework1;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test07 {
    public static void main(String[] args) {
        HashMap<Student1, String> map = new HashMap<>();
        Student1 s1 = new Student1("张三1", 12);
        Student1 s2 = new Student1("张三2", 13);
        Student1 s3 = new Student1("张三3", 14);
        Student1 s4 = new Student1("张三4", 15);
        Student1 s5 = new Student1("张三5", 16);
        String zh1="天河区1";
        String zh2="天河区2";
        String zh3="天河区3";
        String zh4="天河4区";
        String zh5="天河5区";
        map.put(s1,zh1);
        map.put(s2,zh2);
        map.put(s3,zh3);
        map.put(s4,zh4);
        map.put(s5,zh5);
        Set<Student1> student1s = map.keySet();
        for (Student1 student1 : student1s) {
            System.out.println(student1);
        }
        Set<Map.Entry<Student1, String>> entries = map.entrySet();
        for (Map.Entry<Student1, String> entry : entries) {
            System.out.println(entry.getKey()+"--"+entry.getValue());
        }
    }
}
